<template>
<div>
 <el-tag>跟进记录</el-tag>
  <div v-for="item in dataList" style="font-size: 10px;">
    <el-row :gutter="5">
      <el-col :span="8"><span>操作人</span></el-col>
      <el-col :span="16"><span>{{item.operName}}</span></el-col>
    </el-row>
    <el-row>
      <el-col :span="8"><span>操作时间</span></el-col>
      <el-col :span="16"><span>{{parseTime(new Date(item.operTime),'{y}-{m}-{d}')}}</span></el-col>
    </el-row>
    <el-row v-if="item.record">
     <el-col :span="8"><span>操作详情</span></el-col>
      <el-col :span="16"><span>{{item.record}}</span></el-col>
    </el-row>
    <el-row v-if="item.reason">
      <el-col :span="8"><span>伪线索原因</span></el-col>
      <el-col :span="16"><span>{{selectDictLabel(dict.type.reasons_for_reporting, item.reason)}}</span></el-col>
    </el-row>
    <el-row v-if="item.remark">
      <el-col :span="8"><span>伪线索详情</span></el-col>
      <el-col :span="16"><span>{{item.remark}}</span></el-col>
    </el-row>
    <hr>
  </div>
</div>
</template>

<script>
  import {list} from '@/api/monitor/operlog';
  import {listTrackLog} from "../../../../api/crm/trackLog";
    export default {
      dicts: ['reasons_for_reporting'],

      name: "track-list",
      props:['id'],
      data(){
          return{
            dataList:[],
            search: '线索',
          }
      },
      created(){
          this.getList();
      },
      methods:{
          getList(){
            // list({title:'线索跟进记录'}).then(res=>{
            //     this.dataList=this.parseData(res.rows);
            // })
            listTrackLog({id: this.id, table: this.search}).then(resp => {
              this.dataList = resp.rows;
            })
          },
        parseData(result){
            let  list=[];
            if(result && result.length>0){
              for(let  item of result){
                let operParam=JSON.parse(item.operParam);
                if(operParam.id===this.id){
                  item.operParam=operParam;
                  list.push(item);
                }
              }
            }
              return list;
        }
      }
    }
</script>

<style scoped>

</style>
